< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03120104.xhp

(section: val) (bookmark: bm_id3149205)
Val function

Val 関数

Val Function [Runtime]
Val 関数 [実行時](hd_id3149205.1)

Converts a string to a numeric expression.
文字列を数式に変換します。(par_id3153345.2)

(/section: val)

Syntax:
構文:(hd_id3159157.3)

Val (Text As String)
Val (Text As String)(par_id3149514.4)

Return value:
戻り値:(hd_id3150669.5)

Double
倍精度(par_id3143228.6)

Parameters:
パラメータ:(hd_id3156024.7)

Text: String that represents a number.
Text: 数値を示す文字列。(par_id3154348.8)

Using the Val function, you can convert a string that represents numbers into numeric expressions. This is the inverse of the Str function. If only part of the string contains numbers, only the first appropriate characters of the string are converted. If the string does not contain any numbers, the Val function returns the value 0.
Val 関数を使うことで、数値を示す文字列を数値に変換できます。これは、Str 関数の逆の操作を行います。文字列の一部だけが数字である場合、最初の該当部分だけが変換されます。文字列に数字がまったく含まれない場合、Val 関数は0を返します。(par_id3149670.9)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3154365.10)

Sub ExampleVal
Sub ExampleVal(par_id3151177.11)

msgbox Val("123.123")
msgbox Val("123.123")(par_id3159150.12)

msgbox Val("A123.123")
msgbox Val("A123.123")(par_id3154126.13)

end Sub
end Sub(par_id3147229.14)


< Prev / Next >